package com.edocbase.desktop.plugins.mdairy.catalog.ui;

import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

import com.edocbase.biz.diary.entities.DiaryEntity;
import com.edocbase.desktop.lightweight.nodes.MultiLabelProvider;

public class CatalogLabelProvider extends LabelProvider {
	private static CatalogLabelProvider provider= null;
	private MultiLabelProvider labelProvider = new MultiLabelProvider();
	
	CatalogLabelProvider() {
		super();
		labelProvider.registProvider(CatalogNode.class,
				new CatalogNodeLabelProvider());
		labelProvider.registProvider(DiaryEntity.class,
				new DiaryLabelProvider());
		labelProvider.registProvider(RecycledNode.class,
				new RecycledLabelProvider());
	}


	public static CatalogLabelProvider getProvider(){
		if (provider == null){
			provider = new CatalogLabelProvider();
		}
		return provider;
	}


	public void addListener(ILabelProviderListener listener) {
		labelProvider.addListener(listener);
	}


	public void dispose() {
		labelProvider.dispose();
	}


	public boolean equals(Object obj) {
		return labelProvider.equals(obj);
	}


	public Image getImage(Object element) {
		return labelProvider.getImage(element);
	}


	public String getText(Object element) {
		return labelProvider.getText(element);
	}


	public int hashCode() {
		return labelProvider.hashCode();
	}



	public boolean isLabelProperty(Object element, String property) {
		return labelProvider.isLabelProperty(element, property);
	}


	public void removeListener(ILabelProviderListener listener) {
		labelProvider.removeListener(listener);
	}
	
	
}
